<template>
    <van-nav-bar title="首页" />
    <Search></Search>
    <Swipe :images="images"></Swipe>
    <van-grid>
        <van-grid-item v-for="item in catitemsApiData" :icon="item.image_src" :text="item.name" />
        <van-grid-item v-for="item in catitemsApiData" :icon="item.image_src" :text="item.name" />
    </van-grid>
</template>

<script setup>
import Swipe from '@/components/Swipe.vue';
import { swiperdataApi, catitemsApi } from '@/api/api';
import { ref } from 'vue';
import Search from '@/components/Search.vue';
let images = ref([])
swiperdataApi().then((res) => {
    console.log(res);
    images.value = res.data.message
})
let catitemsApiData = ref([])
catitemsApi().then(res => {
    console.log('导航数据', res)
    catitemsApiData.value = res.data.message
})
</script>

<style lang="scss" scoped></style>